# 简化的BOM移除脚本

$javaFiles = Get-ChildItem -Path "src\main\java" -Filter "*.java" -Recurse
$count = 0

foreach ($file in $javaFiles) {
    try {
        $content = Get-Content $file.FullName -Raw -Encoding UTF8
        $content | Set-Content $file.FullName -Encoding UTF8 -NoNewline
        $count++
        if ($count % 10 -eq 0) {
            Write-Host "Processed $count files..."
        }
    }
    catch {
        Write-Host "Error processing file: $($file.Name) - $($_.Exception.Message)"
    }
}

Write-Host "Processed $count files total. BOM removal completed!"